package view;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;

import com.pallas.swing.date.DateComboBox;

@SuppressWarnings("serial")
public class PanelKundenSuchen extends JPanel {

	private JTextField textFieldName;
	private JTextField textFieldKundennummer;
	private JTextField textFieldVorname;
	private DateComboBox textFieldGeburtsdatum;
	private JTabbedPane tpane;

	public PanelKundenSuchen(final JTabbedPane tpane) {
		this.tpane=tpane;
		setLayout(null);
		
		JLabel lblKundennummer = new JLabel("Kundennummer");
		lblKundennummer.setBounds(10, 10, 100, 20);
		add(lblKundennummer);
	
		JLabel lblName = new JLabel("Name");
		lblName.setBounds(10, 35, 100, 20);
		add(lblName);
	
		JLabel lblVorname = new JLabel("Vorname");
		lblVorname.setBounds(10, 60, 100, 20);
		add(lblVorname);
	
		JLabel lblGeburtsdatum = new JLabel("Geburtsdatum");
		lblGeburtsdatum.setBounds(10, 85, 100, 20);
		add(lblGeburtsdatum);
	
		JButton btnNewButton = new JButton("Kunde suchen");
		btnNewButton.setBounds(10, 360, 135, 20);
		btnNewButton.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent arg0) {
				tpane.setEnabledAt(4, true);
			}
		});
		add(btnNewButton);
	
		JButton btnAbbrechen = new JButton("Abbrechen");
		btnAbbrechen.setBounds(155, 360, 110, 20);
		add(btnAbbrechen);
	
		textFieldKundennummer = new JTextField();
		textFieldKundennummer.setBounds(120, 10, 100, 20);
		add(textFieldKundennummer);
		textFieldKundennummer.setColumns(10);
	
		textFieldName = new JTextField();
		textFieldName.setColumns(10);
		textFieldName.setBounds(120, 35, 100, 20);
		add(textFieldName);
	
		textFieldVorname = new JTextField();
		textFieldVorname.setColumns(10);
		textFieldVorname.setBounds(120, 60, 100, 20);
		add(textFieldVorname);
	
		textFieldGeburtsdatum = new DateComboBox();
		textFieldGeburtsdatum.setBounds(120, 85, 100, 20);
		add(textFieldGeburtsdatum);
		
	}

}